home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
vgapal.exe
/
VPALDEMO.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1993-01-21
|
3KB
|
128 lines
Program VpalDemo;
Uses
Dos, Crt, Graph, VGApal;
Var
AutoDetectPointer : Pointer;
BPointer : Pointer;
GraphDriver, Mode : Integer;
ErrorCode : Integer;
X,Y : Integer;
Size : Word;
{$F+}
Function DetectVGA256 : integer;
var
DetectedDriver : integer;
SuggestedMode : integer;
begin
DetectGraph(DetectedDriver, SuggestedMode);
if (DetectedDriver = VGA) or (DetectedDriver = MCGA) then
DetectVGA256 := 0
else
DetectVGA256 := grError;
end;
{$F-}
Begin
ClrScr;
DirectVideo := false;
AutoDetectPointer := @DetectVGA256;
GraphDriver := InstallUserDriver('VGA256', AutoDetectPointer);
begin
AutoDetectPointer := @DetectVGA256;
GraphDriver := InstallUserDriver('VGA256',AutoDetectPointer);
end;
GraphDriver := Detect;
InitGraph(GraphDriver, Mode,'C:\TP\VGA256');
Size := ImageSize(0,0,199,7);
GetMem(BPointer,Size);
SetPalBlack;
Read256PCX('FROGMEAT.PCX');
GetImage(119,170,318,177,BPointer^);
OutTextXY(119,170,'Fade in from black...');
FadeInPalBlack(15);
SavePal;
Delay(3000);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'...and out to white! ');
FadeOutPalWhite(99);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'Fade back from white!');
FadeInPalWhite(15);
Delay(3000);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'Fade a color from... ');
Delay(3000);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'... one to another...');
SaveColorFrom(05);
FadeColorTo(00,24);
Delay(3000);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'... and back again! ');
SColor[0] := 0;
SColor[1] := 0;
SColor[2] := 0;
FadeColorTo(00,24);
Delay(3000);
PutImage(119,170,BPointer^,NormalPut);
OutTextXY(119,170,'Fade out to black... ');
FadeOutPalBlack(99);
SetPalBlack;
Read256PCX('CPANEL.PCX');
GetImage(119,160,318,167,BPointer^);
OutTextXY(119,160,'...load a new file! ');
FadeInPalBlack(15);
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'Switch two colors... ');
SwitchCol(0,12);
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'...back and forth! ');
SwitchCol(0,12);
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'Scroll palette ahead.');
For X := 0 To 255 Do
Begin
CyclePalAhead;
End;
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'Scroll palette back! ');
For X := 0 To 255 Do
Begin
CyclePalBack;
End;
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'Scroll parts ahead...');
For Y := 0 To 15 Do
Begin
For X := 0 To 15 Do
Begin
CycleColAhead(Y*16,Y*16+15);
End;
End;
Delay(3000);
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'and backwards! ');
For Y := 0 To 15 Do
Begin
For X := 0 To 15 Do
Begin
CycleColBack(Y*16,Y*16+15);
End;
End;
PutImage(119,160,BPointer^,NormalPut);
OutTextXY(119,160,'The End!!! ');
Delay(3000);
FadeOutPalBlack(99);
TextMode(LastMode);
End.